package br.com.intelsys.basics.bfactory;

import br.com.intelsys.basics.spring.WebReqGeneric;

public class SpringMvc {

	private Class<WebReqGeneric> webReqClass;

	SpringMvc(String webReqClassName) {
		loadWebReqClass(webReqClassName);
	}

	@SuppressWarnings("unchecked")
	private void loadWebReqClass(String webReqClassName) {
		try {
			webReqClass = (Class<WebReqGeneric>) Class.forName(webReqClassName);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException("A classe '"+webReqClassName+"' nao foi encontrada. Cheque em seu factoryManager.xml pelo atributo 'class' de factory/spring/webrequest.", e);
		}
	}

	public Class<WebReqGeneric> getWebReqClass() {
		return webReqClass;
	}

}
